﻿function initialize() {
    if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map_canvas"));
    map.setCenter(new GLatLng((10.78453 + 10.79245) / 2, (106.69094 + 106.68858) / 2), 15);
    map.setUIToDefault();
		
	// Create a base icon for all of our markers that specifies the
    // shadow, icon dimensions, etc.
    var baseIcon = new GIcon(G_DEFAULT_ICON);
    baseIcon.image = 'http://cit.com.vn/image/company.png';
    //baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon.iconSize = new GSize(32, 32);
    //baseIcon.shadowSize = new GSize(37, 34);
    baseIcon.iconAnchor = new GPoint(9, 34);
    baseIcon.infoWindowAnchor = new GPoint(9, 2);

    var baseIcon1 = new GIcon(G_DEFAULT_ICON);
    baseIcon1.image = 'http://cit.com.vn/image/branch.png';
    //baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
    baseIcon1.iconSize = new GSize(32, 32);
    //baseIcon.shadowSize = new GSize(37, 34);
    baseIcon1.iconAnchor = new GPoint(9, 34);
    baseIcon1.infoWindowAnchor = new GPoint(9, 2);

    var point = new GLatLng(10.78453, 106.69094);
    var point2 = new GLatLng(10.79245, 106.68858);
    var letteredIcon = new GIcon(baseIcon);
    var letteredIcon1 = new GIcon(baseIcon1);
	
	// Set up our GMarkerOptions object
    markerOptions = { icon: letteredIcon, title: "Trụ sở chính CIT" };
    markerOptions1 = { icon: letteredIcon1, title: "Chi nhánh CIT" };
	var marker = new GMarker(point, markerOptions);
	var marker2 = new GMarker(point2, markerOptions1);
	map.addOverlay(marker);
	map.addOverlay(marker2);
    }
}

$(document).ready(function () {
    initialize();
});
